/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.model;

import perpus.*;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author admin
 */
public class TestPinjaman {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Anggota test1 = new Anggota();
       test1.setNama("Benedicta");
        try {
            test1.setIdAnggota("B115314063");
        } catch (Exception ex) {
            Logger.getLogger(TestPinjaman.class.getName()).log(Level.SEVERE, null, ex);
        }

       Publikasi test2 = new Buku();
       test2.setJudul("PBO 2");
        try {
            test2.setIdKoleksi("KOM115314T");
        } catch (Exception ex) {
            Logger.getLogger(TestPinjaman.class.getName()).log(Level.SEVERE, null, ex);
        }
       test2.setPenerbit("Sanata Dharma");
       test2.setPenulis("Budi Darmawan");
       test2.setTahun("2012");

       Date test3= new Date();
       test3.setDate(03);
       test3.setMonth(07);
       test3.setYear(2012);
       
        Date test4 = new Date();
        test4.setDate(10);
        test4.setMonth(07);
        test4.setYear(2012);

       Pinjaman test5 = new Pinjaman (test1,test2, test4);
       Pinjaman.tambahPinjaman(test5);

       int hari = test4.getDate() - test3.getDate();
       
        System.out.println("Daftar Pinjaman");
        System.out.println("DATA : "+
                "\nNama Anggota : "+test1.getNama()+
                "\nID Anggota : "+test1.getIdAnggota());
        System.out.println("Judul Buku yang Dipinjam: "+test2.getJudul());
        System.out.println("tanggal Pinjam : "+test3.getDate()+" - "+test3.getMonth()+" - "+test3.getYear());
        System.out.println("Tanggal Kembali : "+test4.getDate()+" - "+test4.getMonth()+" - "+test4.getYear());

        System.out.println("Jumlah hari Pinjam : "+hari+" Hari");
    }
}
